package com.nuc.bigdata.configer;

import com.nuc.bigdata.util.FeignClientErrorDecoderCommon;
import feign.Response;
import feign.codec.ErrorDecoder;
import org.springframework.context.annotation.Configuration;

/**
 * feign客户端调用服务报错时，客户端进行错误解码
 * 允许你将异常处理到特定的应用中
 * @author JackLuo
 * @date 2019/10/31
 */
@Configuration
public class FeignClientErrorDecoder implements ErrorDecoder {

    @Override
    public Exception decode(String methodKey, Response response) {
        return FeignClientErrorDecoderCommon.errorDecoder(methodKey, response);
    }
}
